import { v4 as uuidv4 } from 'uuid';

const commonOpts =()=>{
  return {
    disX: 0,
    disY: 0,
    length: 0,
    id: uuidv4().replaceAll('-',''),
    top: '0px',
    left: '0px',
  }
}

const compDataTemp =  {

  'Text':()=> {
    const temp = {
      ...commonOpts(),
      fontSize:'16px',
      color:'#333',
      text:'default text',
      fontWeight:''
    }
    return JSON.parse(JSON.stringify(temp))
  },

  'Icon':()=> {
    const temp = {
      ...commonOpts(),
      fontSize:'28px',
      color:'#333',
      icon:'Html5Outlined'
    }
    return JSON.parse(JSON.stringify(temp))
  },

  'Background':()=> {
    const temp = {
      ...commonOpts(),

      background:'#ccc',
      border:'1px solid',
      borderColor:'#333',
      width:'300px',
      height:'150px',
      borderRadius:'0px'

    }
    return JSON.parse(JSON.stringify(temp))
  },

  'Button':()=> {
    const temp = {
      ...commonOpts(),
      
      text:'button',
      type:'default'
    }
    return JSON.parse(JSON.stringify(temp))
  },

  'Upload':()=> {
    const temp = {
      ...commonOpts(),

      action:'https://www.mocky.io/v2/5cc8019d300000980a055e76',
      text:'upload text'
    }
    return JSON.parse(JSON.stringify(temp))
  },

  'Input':()=> {
    const temp = {
      ...commonOpts(),
      width:'auto',
      fieldName: '',
      label: 'label',
      placeholder:'请输入...'
    }
    return JSON.parse(JSON.stringify(temp))
  },
  
  'Select': ()=> {
    const temp = {
      ...commonOpts(),
      fieldName: '',
      label: 'label',
      width:'150px',
      getOptsApi:'http://jsonplaceholder.typicode.com/users',
      method:'get',
      labelName:'',
      valueName:'',
      options:[
        // {label:'label1',value:'val1'},
        // {label:'label2',value:'val2'},
      ]
    }
    return JSON.parse(JSON.stringify(temp))
  }
}
 
export default compDataTemp;